<title>栏目管理 - QAdmin后台模板</title>

<body>

<a href="type_add.html" class="layui-btn"><i class="layui-icon">&#xe654;</i>添加栏目</a>
<table class="layui-table layui-form">
    <colgroup>
        <col width="80">
        <col width="80">
        <col width="150">
        <col width="80">
        <col width="80">
        <col width="80">
        <col>
        <col width="150">
    </colgroup>
    <thead>
    <tr>
        <th>ID</th>
        <th>排序</th>
        <th>名称</th>
        <th>英文名</th>
        <th>显示</th>

        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr class="id9">
        <td>9</td>
        <td>11</td>
        <td>前端</td>
        <td>12</td>
        <td><input data-id="9" lay-filter="state" type="checkbox" checked lay-text="开启|关闭" lay-skin="switch"></td>

        <td><a href="#/9.html">修改</a> | <a class="del" data-id=".id9"
                                                                   href="#/id/9.html">删除</a></td>
    </tr>
    <tr class="id9">
        <td>11</td>
        <td>1</td>
        <td>|----------html/css</td>
        <td>html_css</td>
        <td><input type="checkbox" data-id="11" lay-filter="state" checked lay-text="开启|关闭" lay-skin="switch"></td>

        <td><a href="#/11.html">修改</a> | <a class="del" data-id=".id11"
                                                                    href="#/id/11.html">删除</a></td>
    </tr>
    <tr class="id9">
        <td>16</td>
        <td>2</td>
        <td>|----------javascript</td>
        <td>javascript</td>
        <td><input type="checkbox" data-id="16" lay-filter="state" checked lay-text="开启|关闭" lay-skin="switch"></td>

        <td><a href="#/16.html">修改</a> | <a class="del" data-id=".id16"
                                                                    href="#/id/16.html">删除</a></td>
    </tr>
    <tr class="id9">
        <td>20</td>
        <td>3</td>
        <td>|----------jquery</td>
        <td>jquery</td>
        <td><input type="checkbox" data-id="20" lay-filter="state" checked lay-text="开启|关闭" lay-skin="switch"></td>

        <td><a href="#/20.html">修改</a> | <a class="del" data-id=".id20"
                                                                    href="#/id/20.html">删除</a></td>
    </tr>
    <tr class="id9">
        <td>15</td>
        <td>4</td>
        <td>|----------vue</td>
        <td>vue</td>
        <td><input type="checkbox" data-id="15" lay-filter="state" checked lay-text="开启|关闭" lay-skin="switch"></td>

        <td><a href="#/15.html">修改</a> | <a class="del" data-id=".id15"
                                                                    href="#/id/15.html">删除</a></td>
    </tr>
    <tr class="id9">
        <td>12</td>
        <td>5</td>
        <td>|----------angular</td>
        <td>angular</td>
        <td><input type="checkbox" data-id="12" lay-filter="state" checked lay-text="开启|关闭" lay-skin="switch"></td>

        <td><a href="#/12.html">修改</a> | <a class="del" data-id=".id12"
                                                                    href="#/id/12.html">删除</a></td>
    </tr>
    <tr class="id9">
        <td>25</td>
        <td>99</td>
        <td>|----------小程序</td>
        <td>xcx</td>
        <td><input type="checkbox" data-id="25" lay-filter="state" checked lay-text="开启|关闭" lay-skin="switch"></td>

        <td><a href="#/25.html">修改</a> | <a class="del" data-id=".id25"
                                                                    href="#/id/25.html">删除</a></td>
    </tr>
    <tr class="id13">
        <td>13</td>
        <td>22</td>
        <td>后端</td>
        <td>1111111111111</td>
        <td><input data-id="13" lay-filter="state" type="checkbox" checked lay-text="开启|关闭" lay-skin="switch"></td>

        <td><a href="#/13.html">修改</a> | <a class="del" data-id=".id13"
                                                                    href="#/id/13.html">删除</a></td>
    </tr>
    <tr class="id13">
        <td>17</td>
        <td>1</td>
        <td>|----------php</td>
        <td>php</td>
        <td><input type="checkbox" data-id="17" lay-filter="state" checked lay-text="开启|关闭" lay-skin="switch"></td>

        <td><a href="#/17.html">修改</a> | <a class="del" data-id=".id17"
                                                                    href="#/id/17.html">删除</a></td>
    </tr>
    <tr class="id13">
        <td>14</td>
        <td>2</td>
        <td>|----------node.js</td>
        <td>nodejs</td>
        <td><input type="checkbox" data-id="14" lay-filter="state" checked lay-text="开启|关闭" lay-skin="switch"></td>

        <td><a href="#/14.html">修改</a> | <a class="del" data-id=".id14"
                                                                    href="#/id/14.html">删除</a></td>
    </tr>
    <tr class="id13">
        <td>18</td>
        <td>3</td>
        <td>|----------python</td>
        <td>python</td>
        <td><input type="checkbox" data-id="18" lay-filter="state" checked lay-text="开启|关闭" lay-skin="switch"></td>

        <td><a href="#/18.html">修改</a> | <a class="del" data-id=".id18"
                                                                    href="#/id/18.html">删除</a></td>
    </tr>
    <tr class="id13">
        <td>24</td>
        <td>4</td>
        <td>|----------linux/shell</td>
        <td>linux_shell</td>
        <td><input type="checkbox" data-id="24" lay-filter="state" checked lay-text="开启|关闭" lay-skin="switch"></td>

        <td><a href="#/24.html">修改</a> | <a class="del" data-id=".id24"
                                                                    href="#/id/24.html">删除</a></td>
    </tr>
    <tr class="id19">
        <td>19</td>
        <td>33</td>
        <td>数据库</td>
        <td>sql</td>
        <td><input data-id="19" lay-filter="state" type="checkbox" checked lay-text="开启|关闭" lay-skin="switch"></td>

        <td><a href="#/19.html">修改</a> | <a class="del" data-id=".id19"
                                                                    href="#/id/19.html">删除</a></td>
    </tr>
    <tr class="id19">
        <td>21</td>
        <td>1</td>
        <td>|----------mysql</td>
        <td>mysql</td>
        <td><input type="checkbox" data-id="21" lay-filter="state" checked lay-text="开启|关闭" lay-skin="switch"></td>

        <td><a href="#/21.html">修改</a> | <a class="del" data-id=".id21"
                                                                    href="#/id/21.html">删除</a></td>
    </tr>
    <tr class="id19">
        <td>22</td>
        <td>2</td>
        <td>|----------redis</td>
        <td>redis</td>
        <td><input type="checkbox" data-id="22" lay-filter="state" checked lay-text="开启|关闭" lay-skin="switch"></td>

        <td><a href="#/22.html">修改</a> | <a class="del" data-id=".id22"
                                                                    href="#/id/22.html">删除</a></td>
    </tr>
    <tr class="id19">
        <td>23</td>
        <td>3</td>
        <td>|----------mongodb</td>
        <td>mongodb</td>
        <td><input type="checkbox" data-id="23" lay-filter="state" checked lay-text="开启|关闭" lay-skin="switch"></td>

        <td><a href="#/23.html">修改</a> | <a class="del" data-id=".id23"
                                                                    href="#/id/23.html">删除</a></td>
    </tr>
    </tbody>
</table>

<script>
layui.use('form', function() {
    const form = layui.form; const layer = layui.layer; const $ = layui.jquery;

    form.on('switch(state)', function(data) {
        const id = $(data.elem).attr('data-id');
        $.ajax({
            url: '/admin/category/state/type/state.html',
            data: {
                id: id,
            },
            type: 'get',
            dataType: 'json',
            success: function(e) {
                if (e.code == 1) {
                    layer.msg(e.msg, {
                        icon: 1,
                    });
                } else {
                    layer.msg(e.msg, {
                        icon: 2,
                        shade: 0.5,
                        time: 2000,
                        shadeClose: true,
                    });
                }
            },
        });
    });
});
</script>


